package com.it.share.origin.jdk;

import com.it.share.origin.Man;
import lombok.AllArgsConstructor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author Simon
 * @date 2021年07月02日 23:36
 */
@AllArgsConstructor
public class ManInvocationHandler implements InvocationHandler {

    private Man man;

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("请讲话:");
        man.say();

        return man;
    }
}
